﻿namespace FreeSwitch.EventSocket.CallHandling
{
	/// <summary>
	/// States that calls can have.
	/// </summary>
	public enum CallState
	{
		Unknown,

		/// <summary>
		/// The call has been created, but Connect has not been called yet. 
		/// A call can never transition into the idle state. 
		/// This is the initial state for both incoming and outgoing calls.
		/// </summary>
		Idle,

		/// <summary>
		/// Connect has been called, and the service provider is working on 
		/// making a connection. This state is valid only on outgoing calls. 
		/// This message is optional, because a service provider may have a 
		/// call transition directly to the connected state.
		/// </summary>
		InProgress,

		/// <summary>
		/// Call has been connected to the remote end and communication can take place.
		/// </summary>
		Connected,

		/// <summary>
		/// Call has been disconnected. There are several causes for disconnection. 
		/// See the table of valid call state transitions below.
		/// </summary>
		Disconnected,

		/// <summary>
		/// Inbound call is ringing
		/// </summary>
		Offering,

		/// <summary>
		/// Outbound call is ringing
		/// </summary>
		Alerting,

		/// <summary>
		/// The call is in the hold state.
		/// </summary>
		Held,
	}
}